package cn.jekun.shop.common.service;

import java.util.List;

import javax.annotation.Resource;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Service;

import cn.jekun.component.core.bean.gen.ErpSpeType;
import cn.jekun.component.core.service.gen.ErpSpeTypeService;

@Service(SpeTypeService.BEAN_NAME)
public class SpeTypeService extends ShopBaseService {
	public static final String BEAN_NAME = "cn.jekun.shop.common.SpeTypeService";

	@Resource(name = ErpSpeTypeService.BEAN_NAME)
	ErpSpeTypeService speTypeService;

	public JSONObject getSpeTypes() {
		
		JSONObject jsonObject = new JSONObject();
		
		try {
			List<ErpSpeType> ErpSpeTypes = this.speTypeService.list(null);
			ErpSpeType erpSpeType = new ErpSpeType();
			erpSpeType.setSpeTypeId("");
			erpSpeType.setName("全部");
			ErpSpeTypes.add(0,erpSpeType);
			jsonObject.put("data",ErpSpeTypes);
		} catch (Exception e) {
			e.printStackTrace();
			return executeRerutnFail(jsonObject);
		}
		
		return executeRerutn(jsonObject);

	}
	

}
